//
// Created by guanyicheng on 2022/3/14.
//

#include "../../common.h"

class Solution {
public:
    bool canConstruct(string ransomNote, string magazine) {
        unordered_map<char, int> map1{};
        for (char c: magazine) {
            map1[c]++;
        }
        for(char c: ransomNote) {
            if (--map1[c] < 0) {
                return false;
            }
        }
        return true;
    }
};